Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum





Javascript Submit executes form.submit despite errors
~Ned Umfreecheknivu 02/26/2007 03:55 PM
Domino Designer 6.5.4 All Platforms


Good Day All,

I am having an issue were when I click submit the f.submit() at the end of my code is executing, despite the fact that it should have errored out and returned false?

function f_Submit()
{
var f = document.forms[0];
if ( f.User_Name.value=="" )
{
alert ("Please enter your Name.");
f.User_Name.focus();
f.User_Name.select();
return false;
}
if ( f.Contact_Number.value=="Please update your info in the Global Address Book (names.nsf)")
{
alert ("Please enter your Phone Nunber.");
f.Contact_Number.focus();
f.Contact_Number.select();
return false;
}
if ( f.Contact_Number.value=="" )
{
alert ("Please enter your Phone Nunber.");
f.Contact_Number.focus();
f.Contact_Number.select();
return false;
}
f.submit();
return true;
}

I cannot find where my error is in this script.
Any help would be appreciated as awlays.... Just need that second set of eyes.... Or wish mine worked...

Go back